package org.zjvis.datascience.common.dto.gis;

import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.zjvis.datascience.common.dto.BaseDTO;
import org.zjvis.datascience.common.vo.gis.GisLayersVO;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class GisLayersDTO extends BaseDTO {
    private static final long serialVersionUID = 67638283075612719L;
    private Long id;

    private Long userId;

    private String layerName;

    private String dataJson;

    private Long tabId;

    private Long projectId;

    private Long pipelineId;

    private Long taskId;

    private String sourceTable;

    private String viewTable;

    private Long visible;

    private String type;

    private Long layerOrder;

    public GisLayersVO layer() {
        GisLayersVO layer = new GisLayersVO();
        layer.setId(id);
        layer.setName(layerName);
        layer.setType(type);
        layer.setVisible(visible);
        layer.setOrder(layerOrder);
        layer.setViewName(viewTable);
        layer.setData(JSONObject.parseObject(dataJson));
        return layer;
    }


}
